#ifndef __Function_h
#define __Function_h

#define TESTLED       (1ul << 8)
#define TESTLEDInit    GPIO2DIR |=  TESTLED 
#define TESTLEDOFF()   GPIO2DATA |=  TESTLED                                                  
#define TESTLEDON()    GPIO2DATA &= ~TESTLED 

#define CLK_LOW()      GPIO2DATA  &=  ~(1 << 4)  
#define CLK_HIGH()     GPIO2DATA  |=  (1 << 4) 
#define DATA_LOW()     GPIO2DATA  &=  ~(1 << 5)  
#define DATA_HIGH()    GPIO2DATA  |=  (1 << 5) 

#define nRF_PIN_SendInit()     GPIO3DIR   |= 0X37
#define nRF_PIN_ReceiveInit()  GPIO3DIR   |= 0X17
#define nRF_PWR_UP_ON()        GPIO3DATA  |=  (1 << 0) 
#define nRF_CE_ON()            GPIO3DATA  |=  (1 << 1)
#define nRF_CS_ON()            GPIO3DATA  |=  (1 << 2)
#define nRF_DR1_ON()           GPIO3DATA  |=  (1 << 3)
#define nRF_CLK1_ON()          GPIO3DATA  |=  (1 << 4)
#define nRF_DATA_ON()          GPIO3DATA  |=  (1 << 5)

#define nRF_PWR_UP_OFF()       GPIO3DATA  &=  ~(1 << 0) 
#define nRF_CE_OFF()           GPIO3DATA  &=  ~(1 << 1) 
#define nRF_CS_OFF()           GPIO3DATA  &=  ~(1 << 2) 
#define nRF_DR1_OFF()          GPIO3DATA  &=  ~(1 << 3) 
#define nRF_CLK1_OFF()         GPIO3DATA  &=  ~(1 << 4) 
#define nRF_DATA_OFF()         GPIO3DATA  &=  ~(1 << 5) 

#define nRF_DR1_Read()      (GPIO3DATA & (1 << 3))
#define nRF_DATA_Read()     (GPIO3DATA & (1 << 5)) 

void StringDisplayONLCD(uint8 iPlace, char *iStrTOsend);
void LEDTest(uint8 LEDStyle);
void function(void);
void mode_choice(uint8 iModestyle);
void nRF_string_set(uint8 iAddress[], uint8 iAddressLength, uint8 pStrTOsend);
void timedelay(uint32 iDelayPat);
void nRF_string_set(uint8 iAddress[],uint8 iAddressLength,uint8 pStrTOsend);
void nRF_Read_byte(uint8 *pStr);
uint8 nRF_Receive_Judge(void);
#endif
